package com.ming.dubbo.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.ming.dubbo.service.TestService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
@Slf4j
public class TestController {
    @Reference(interfaceClass = TestService.class,version = "1.0-SNAPSHOT",check = true,filter = {"globalTraceFilter"})
    private TestService testService;
    // debug dubbo拦截器
    @RequestMapping("/debug/interceptor")
    public String test(){
        log.info("test controller start...");
        String now = testService.test();
        log.info("test controller end...");
        return now;
    }
}
